<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://47.106.66.89:8080/js/axios.min.js"></script>
</head>
<body>
hello
<form action="consume" method="post" enctype="application/x-www-form-urlencoded">
    <button>提交表单请求</button>
</form>
<form action="consume" method="post" enctype="multipart/form-data">
    <button>提交文件上传请求</button>
</form>
<h3>自动装箱</h3>
<form action="http://localhost:8080/spring_mvc_war_exploded/body2" method="post" enctype="application/x-www-form-urlencoded">
    <input name="name"><br>
    <input name="age" type="number"><br>
    <input name="like" type="checkbox" value="篮球">篮球
    <input name="like" type="checkbox" value="手游">手游
    <input name="like" type="checkbox" value="街舞">街舞<br>
    <input name="father.name"><br>
    <input name="father.age" type="number"><br>
    <input name="mather.name"><br>
    <input name="mather.age" type="number"><br>
    <button>自动装箱</button>
</form>

<button onclick="a()">axios 发送json</button>
<button onclick="b()">axios 发送json1</button>
<script>
    function a(){
        axios.post("body",{
            name: "张三",
            age: 10,
            like: ["篮球","街舞"],
            father:{
                name: "李四",
                age: 30,
                like: ["篮球","街舞"]
            }
        }).then(res=>{
            console.info(res.data);
            alert(res.data);
        })

    }

    function b(){
        axios.post("body1",{
            name: "张三",
            age: 10,
            like: ["篮球","街舞"],
            father:{
                name: "李四",
                age: 30,
                like: ["篮球","街舞"]
            }
        }).then(res=>{
            console.info(res.data);
            alert(res.data);
        })

    }
</script>





</body>
</html>